package com.group.yztcedu.playlive.main.playvideo;

import com.group.yztcedu.playlive.bean.PlayVideoBean;
import com.group.yztcedu.playlive.utils.HttpUtils;

import java.util.HashMap;

/**
 * Created by Administrator on 2016/8/16.
 */
public class PlayVideoPresenter implements PlayVideoContract.Presenter {
    private PlayVideoContract.View view;
    private PlayVideoContract.Model model;
    public PlayVideoPresenter(PlayVideoContract.View view,PlayVideoContract.Model model){
        this.view = view;
        this.model = model;
    }
    @Override
    public void initData(String roomId,HashMap<String, String> params) {
        model.getPlayVideoData(roomId,params, new HttpUtils.HttpCallBack<PlayVideoBean>() {
            @Override
            public void onSuccess(PlayVideoBean playVideoBean) {
                view.onSuccessGetPlayVideo(playVideoBean.getData());
            }
            @Override
            public void onFail() {
                view.onFailGetPayVideo("网络连接错误");
            }
        });
    }
}
